package com.qingcheng.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.qingcheng.dao.AdminMapper;
import com.qingcheng.dao.AdminRoleMapper;
import com.qingcheng.dao.RoleMapper;
import com.qingcheng.entity.PageResult;
import com.qingcheng.pojo.system.Admin;
import com.qingcheng.pojo.system.AdminRole;
import com.qingcheng.pojo.system.AdminRoleTB;
import com.qingcheng.pojo.system.Role;
import com.qingcheng.service.system.AdminRoleService;
import com.qingcheng.service.system.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import tk.mybatis.mapper.entity.Example;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Service
public class AdminRoleServiceImpl implements AdminRoleService {

    @Autowired
    private AdminRoleMapper adminRoleMapper;

    @Override
    public void add(AdminRoleTB adminRoleTB) {
        adminRoleMapper.insert(adminRoleTB);
    }

    @Override
    public void update(AdminRoleTB adminRoleTB) {
        adminRoleMapper.deleteByAdminId(adminRoleTB.getAdminId());
        adminRoleMapper.updateByPrimaryKey(adminRoleTB);
    }

    @Override
    public void delete(AdminRoleTB adminRoleTB) {
        adminRoleMapper.deleteByPrimaryKey(adminRoleTB.getAdminId());
    }
}
